package org.zfes.snowier.cloud.zbss.pmp.router.service.pub;

import java.util.Map;
import java.util.Optional;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.zfes.snowier.core.data.DataSet;
import org.zfes.snowier.web.controller.BaseController;
import org.zfes.snowier.cloud.zbss.pmp.model.PmpTasks;
import org.zfes.snowier.cloud.zbss.pmp.service.IPmpTasksService;
@Controller("org.zfes.snowier.cloud.zbss.pmp.router.service.pub.pmpTasksController") 
@RequestMapping("/pmp/service/pub/pmpTasks")
public class PmpTasksController extends BaseController {

	
	@Autowired
	private IPmpTasksService pmpTasksService;

   
    @RequestMapping(value="/loadPmpTasksDataSet", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    public @ResponseBody  Object loadPmpTasksDataSet(@RequestParam Map<String,Object> params){
    	DataSet dataSet=  pmpTasksService.loadPmpTasksDataSet(params);
	    return ajaxQuery("dataSet", dataSet);
    }

    
    @RequestMapping(value="/loadPmpTasks", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    public @ResponseBody  Object loadPmpTasks(Long id){
		Optional<PmpTasks> ops = pmpTasksService.loadPmpTasksById(id);
		return ajaxQuery("pmpTasks",ops);
    }
    
   

}